﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class giohang_Default : System.Web.UI.Page
{

    string masanpham = "a1", tensanpham = "Ao so mi", giasp = "100000";
    Boolean bac = false;

    public Boolean Bac
    {
        get { return bac; }
        set { bac = value; }
    }

    public string Giasp
    {
        get { return giasp; }
        set { giasp = value; }
    }

    public string Tensanpham
    {
        get { return tensanpham; }
        set { tensanpham = value; }
    }

    public string Masanpham
    {
        get { return masanpham; }
        set { masanpham = value; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Bac)
            {
                Masanpham = "";
                Tensanpham = "";
                Giasp = "";
            }
            string[] sessionarry = { masanpham, tensanpham, giasp };
            Session["my_sess"] = sessionarry;
            string[] get_Session_Item = (string[])Session["my_sess"];

            for (int i = 0; i < get_Session_Item.Length; i++)
            {
                Response.Write(get_Session_Item[i] + " ");
            }
        }
        else {
            if (Bac)
            {
                Masanpham = "";
                Tensanpham = "";
                Giasp = "";
            }
            string[] sessionarry = { masanpham, tensanpham, giasp };
            Session["my_sess"] = sessionarry;
            string[] get_Session_Item = (string[])Session["my_sess"];

            for (int i = 0; i < get_Session_Item.Length; i++)
            {
                Response.Write(get_Session_Item[i] + " ");
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        

        bac = true;
    }
}